<?php
	$sql = new db();
	
	$req = "SELECT SUM(tour.Kilometrage) AS parc_km, EmissionCo2_par_KM AS emi FROM tournee AS tour, camion AS ca WHERE date_debut > '".$_POST['date_deb']." 00:00:00' AND date_fin < '".$_POST['date_fin']."23:59:59' AND tour.Matricule = ".$_GET['matri']." AND ca.Matricule = ".$_GET['matri'];
	$sql->query($req);
	$res = $sql->fetch_array();
	
	$carbu = 0;
	$emission = $res['parc_km'] * $res['emi'];
?>